<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
    </style>
</head>
<body>
    <input type="text" name="user" placeholder="请输入账号" class="user">
    <input type="text" name="psw" placeholder="请输入密码" class="psw">
    <button class="btn">登录</button>


    <script>
        let btn = document.querySelector(".btn")
        let user = document.querySelector(".user")
        let psw = document.querySelector(".psw")
        btn.addEventListener("click",function(){
            location.href = `./test2.html?user=${user.value}&psw=${psw.value}`
        })
    </script>
</body>
</html>